import { MouseEventHandler } from "react"

export type TIconType = 'primary' | 'disabled' | 'white' | 'danger' | 'light'
export type TIconProps = {
    color: string,
    size: number,
    isLine?: boolean
}

export type TUser = {
    _id: string
    username: string
    avatar: string
    phone?: string
}

export type Member = {
    userId: string;
    username: string;
 };

export type TGroup = {
    _id: string;
    group_name: string;
    budget: number;
    desc: string;
    createdBy: string;
    members:  Array<TUser>;
    updatedAt: string;
};

export type TCategory = {
    _id: string;
    category_name: string;
    color: string;
    icon: IconKey;
}
export type BillDetail ={
    account: number
    userId: string
    username: string
}
export type TBill = {
    _id: string;
    bill_desc: string;
    category: TCategory;
    account: number;
    members: Array<TUser>
    createdBy: TUser
    updatedAt: string
    createdAt: string
    mode: string
    filterdDetails?:Array<BillDetail>
    details: Array<BillDetail>
    payStatus: 'to_be_collected' | 'collected'
}
export type TBillList = {
    [key: string]: Array<TBill>
};

export enum ValidateType {
    username,
    password,
    email,
    confirmPassword,
    phone
}

export enum EJobType {
    FULL_TIME = 'FULL_TIME',
    PART_TIME = 'PART_TIME',
    REMOTE = 'REMOTE',
    INTERNSHIP = 'INTERNSHIP'
}
export enum EStatus {
    INTERVIEW = 'INTERVIEW',
    DECLINED = 'DECLINED',
    PENDING = 'PENDING'
}


export type TJob = {
    _id?: string;
    company: string;
    position: string;
    location: string;
    jobType: EJobType;
    createdAt?: string;
    status?: string;
    createdBy?: string;
    [key: string]: any;
};


export enum TSort {
    latest = 'latest',
    oldest = 'oldest',
    posAsc = 'posAsc',
    posDesc = 'posDesc',
}

export type TFilter = {
    company: string;
    status: string;
    jobType: string;
    sort: TSort;
};

export interface IconProps {
    type?: TIconType;
    size?: number;
    isLine?: boolean;
    badge?: boolean
    className?: string // 容器样式
    onClick?: MouseEventHandler<HTMLSpanElement>
}


export type IconKey = "all" | "happy" | "hotel" | "meal" | "shopping" | "ticket" | "transport" | "drink" | "notice" | "bill" | "stats" | "user"

export enum NoticeType {
    SEND_INVITATION = 'SEND_INVITATION', //  邀请人 - 发送邀请 
    RECEIVE_INVITATION = 'RECEIVE_INVITATION',//  被邀请人 - 拿到邀请    
    INFORMED_ACCEPT_INVITATION = 'INFORMED_ACCEPT_INVITATION',// 邀请人 - 被告知接受邀请
    INFORMED_REJECT_INVITATION = 'INFORMED_REJECT_INVITATION',// 邀请人 - 被告知拒绝邀请
    ACCEPT_INVITATION = 'ACCEPT_INVITATION',// 被邀请人 - 记录接受邀请
    REJECT_INVITATION = 'REJECT_INVITATION',// 被邀请人 - 记录拒绝邀请
    KICK_OUT_MEMBER = 'KICK_OUT_MEMBER',// 邀请人 - 踢出邀请人
    INFORMED_KICK_OUT_MEMBER = 'INFORMED_KICK_OUT_MEMBER' // 被邀请人 - 被告知踢出
}

export interface CommonProps extends React.HTMLAttributes<HTMLDivElement> {
    children: React.ReactNode;
}

export interface TouchExtendEvent {
    onSwipeLeft?: () => void;
    onSwipeRight?: () => void;
}

export interface CustomProps extends CommonProps, TouchExtendEvent {
    children: React.ReactNode;
}

